﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace wfdbg
{
    public partial class DbgSelectMode : Form
    {
        private string m_InitString = null;
        private uint m_ProcessId = 0;
        
        private void FireWire_Selected()
        {
            m_InitString = "1394:channel=" + Channel_ud.Value.ToString();
        }

        public DbgSelectMode()
        {
            m_InitString = null;
            InitializeComponent();
        }
        
        public string GetInitString()
        {
            return m_InitString;
        }

        public uint GetProcessId()
        {
            return m_ProcessId;
        }

        private void ButtonOk_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void ButtonCancel_Click(object sender, EventArgs e)
        {
            if (null != m_InitString)
                m_InitString = null;
            Close();
        }

        private void kd1394_Click(object sender, EventArgs e)
        {
            FireWire_Selected();
        }

        private void kdcom_Click(object sender, EventArgs e)
        {
        }

        private void kdpipe_Click(object sender, EventArgs e)
        {

        }

        private void Channel_ud_Validated(object sender, EventArgs e)
        {
            FireWire_Selected();
        }

        private void ProcessId_Validated(object sender, EventArgs e)
        {
            m_ProcessId = (uint) ProcessId.Value;
            m_InitString = null;
        }

        private void dbgprocess_CheckedChanged(object sender, EventArgs e)
        {
            ProcessId.Focus();
        }
    }
}
